package com.example.banksys;

import DataBase.DBMsg;
import handler.tellerbusinessHandler;
import javafx.fxml.FXML;
import javafx.scene.control.*;

import java.sql.SQLException;

public class AccountCreatePageController {

    @FXML
    public ComboBox<String> choiceBox;
    public PasswordField passwd;
    public TextField premoney;

    public TextField identityID;


    public void initialize(){
        choiceBox.getItems().addAll("存折","存单","借记卡","信用卡");
    }

    public void AccountCreate() throws SQLException {
        tellerbusinessHandler t=new tellerbusinessHandler();
        DBMsg msg=t.AccountCreate(identityID.getText(),choiceBox.getValue(),premoney.getText(),passwd.getText());
        Alert alert = new Alert(Alert.AlertType.INFORMATION);
        alert.titleProperty().set("信息");
        alert.headerTextProperty().set(msg.getInfo());
        alert.showAndWait();
    }
}
